home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWStream / Include / SLRanSin.xh < prev    next >
Encoding:
Text File  |  1996-08-16  |  5.1 KB  |  218 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLRanSin.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *     File:        SLRanSin.idl
  13.  * 
  14.  *     Contains:    Interface for abstract random access sink class
  15.  * 
  16.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  17.  * 
  18.  */
  19.  
  20.  
  21. #ifndef SOM_FW_ORandomAccessSink_xh
  22. #define SOM_FW_ORandomAccessSink_xh
  23.  
  24. class FW_ORandomAccessSink;
  25.  
  26. #define FW_ORandomAccessSink_MajorVersion 1
  27. #define FW_ORandomAccessSink_MinorVersion 0
  28.  
  29. /*
  30.  * Passthru lines: File: "C.xh", "before"
  31.  */
  32.  
  33.  
  34. /* C++ SOM defs */
  35. #include <somcls.xh>
  36. #include <somcm.xh>
  37.  
  38. /* C++ parent defs */
  39. #ifndef SOM_FW_OSink_xh
  40. #include <SLASinks.xh>
  41. #endif
  42.  
  43. #ifndef FW_ORandomAccessSink_API
  44. #define FW_ORandomAccessSink_API
  45. /*
  46.  * -- The Class API
  47.  */
  48.  
  49. /*
  50.  * Start of user-defined types:
  51.  */
  52. class SOMClass;
  53. class SOMObject;
  54. class FW_OSink;
  55. class FW_ORandomAccessSink;
  56.  
  57. /*
  58.  * End of user-defined types.
  59.  */
  60.  
  61. #ifdef OLDIBMSOMAPISUPPORT
  62. #define FW_ORandomAccessSinkCClassData FW_ORandomAccessSinkClassData
  63. #define FW_ORandomAccessSinkNewClass(major,minor) somNewVersionedClassReference(FW_ORandomAccessSink,major,minor)
  64. #endif
  65.  
  66. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  67. #define FW_ORandomAccessSinkMetaClass SOMClass
  68.  
  69. #if PRAGMA_ALIGN_SUPPORTED
  70. #  pragma options align=power
  71. #endif
  72.  
  73. /* The API to the FW_ORandomAccessSink class object, and the methods it introduces. */
  74. SOMEXTERN struct FW_ORandomAccessSinkClassDataStructure {
  75. #ifdef OLDIBMSOMAPISUPPORT
  76.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  77. #else
  78.     long zero;
  79. #endif
  80.     somStaticClassInfo *sci;
  81.     somDToken        instanceDataToken;
  82.     long reserved [3];
  83.     somMToken GetLength;
  84.     somMToken SetLength;
  85.     somMToken GetPosition;
  86.     somMToken SetPosition;
  87. } SOMDLINK FW_ORandomAccessSinkClassData;
  88.  
  89. #if PRAGMA_ALIGN_SUPPORTED
  90. #  pragma options align=reset
  91. #endif
  92.  
  93. #if !defined(FW_ORandomAccessSink_Class_Source) && !defined(SOM_Module_slransin_Source)
  94. #if PRAGMA_IMPORT_SUPPORTED
  95. #pragma import list FW_ORandomAccessSinkClassData
  96. #endif
  97. #endif
  98.  
  99.  
  100. /*
  101.  * -- Typedefs and inline method declarations for left path inherited methods
  102.  * -- are omitted because this compilation had -museinheritedmethods in effect
  103.  */
  104.  
  105.  
  106. /*
  107.  * -- Typedefs for FW_ORandomAccessSink Method Procedures
  108.  */
  109. SOMEXTERN {
  110. typedef long   (* SOMLINK somTD_FW_ORandomAccessSink_GetLength)(FW_ORandomAccessSink *somSelf, Environment *ev);
  111. typedef void   (* SOMLINK somTD_FW_ORandomAccessSink_SetLength)(FW_ORandomAccessSink *somSelf, Environment *ev,
  112.         long length);
  113. typedef long   (* SOMLINK somTD_FW_ORandomAccessSink_GetPosition)(FW_ORandomAccessSink *somSelf, Environment *ev);
  114. typedef void   (* SOMLINK somTD_FW_ORandomAccessSink_SetPosition)(FW_ORandomAccessSink *somSelf, Environment *ev,
  115.         long position);
  116. }
  117.  
  118. #endif /* FW_ORandomAccessSink_API */
  119.  
  120.  
  121. /*
  122.  * -- This emitter treats Method Tokens as Thunks by default.
  123.  * -- Use the sc modifier "nothunks" to change this default
  124.  */
  125. #undef somresolve_
  126. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  127.  
  128. /*
  129.  * -- The C++ Wrapper Class for FW_ORandomAccessSink
  130.  */
  131. class FW_ORandomAccessSink : public FW_OSink
  132. {
  133. public:
  134.  
  135. // FW_ORandomAccessSink::new registers use of the class object, and then uses somNew
  136. // to allocate memory and load the object method table pointer. 
  137. void *operator new(size_t size)
  138. {
  139.     SOM_IgnoreWarning(size);
  140.     // Allocate memory using the default allocator for FW_ORandomAccessSink, and
  141.     // clear mem & set method table pointer, call basic initialization
  142. #ifdef SOMCHKNULL
  143.     void * __somResult = (void *)
  144.       somNewObject(FW_ORandomAccessSink);
  145.     SOMCHKNULL(__somResult);
  146.     return __somResult;
  147. #else
  148.     return (void*) somNewObject(FW_ORandomAccessSink);
  149. #endif
  150. }
  151.  
  152. // FW_ORandomAccessSink::delete uses the default deallocator for the object's class.
  153. void operator delete(void * obj)
  154. {
  155.     if (obj) {
  156.         SOM_Resolve(obj,SOMObject,somFree)
  157.            ( (SOMObject*) obj );
  158.     }
  159. }
  160.  
  161. /* method: GetLength */
  162. long   GetLength(Environment *ev)
  163. {
  164.    #ifdef SOMCHKEXCEPT
  165.    long __somResult = 
  166.       SOM_ResolveD(this,FW_ORandomAccessSink,FW_ORandomAccessSink,GetLength)
  167.     (this,ev);
  168.       SOMCHKEXCEPT;
  169.    return __somResult;
  170. #else
  171.    return SOM_ResolveD(this,FW_ORandomAccessSink,FW_ORandomAccessSink,GetLength)
  172.     (this,ev);
  173. #endif
  174. }
  175.  
  176. /* method: SetLength */
  177. void   SetLength(Environment *ev,
  178.         long length)
  179. {
  180.    SOM_ResolveD(this,FW_ORandomAccessSink,FW_ORandomAccessSink,SetLength)
  181.     (this,ev,length);
  182. #ifdef SOMCHKEXCEPT
  183.       SOMCHKEXCEPT;
  184. #endif
  185. }
  186.  
  187. /* method: GetPosition */
  188. long   GetPosition(Environment *ev)
  189. {
  190.    #ifdef SOMCHKEXCEPT
  191.    long __somResult = 
  192.       SOM_ResolveD(this,FW_ORandomAccessSink,FW_ORandomAccessSink,GetPosition)
  193.     (this,ev);
  194.       SOMCHKEXCEPT;
  195.    return __somResult;
  196. #else
  197.    return SOM_ResolveD(this,FW_ORandomAccessSink,FW_ORandomAccessSink,GetPosition)
  198.     (this,ev);
  199. #endif
  200. }
  201.  
  202. /* method: SetPosition */
  203. void   SetPosition(Environment *ev,
  204.         long position)
  205. {
  206.    SOM_ResolveD(this,FW_ORandomAccessSink,FW_ORandomAccessSink,SetPosition)
  207.     (this,ev,position);
  208. #ifdef SOMCHKEXCEPT
  209.       SOMCHKEXCEPT;
  210. #endif
  211. }
  212.  
  213. };   /* FW_ORandomAccessSink */
  214.  
  215.  
  216.  
  217. #endif       /* SOM_FW_ORandomAccessSink_xh */
  218.